using System;
using System.Net;

namespace Weather.com.Client.WeatherConditions.Common
{
    internal class CustomWebClient : WebClient
    {
        internal CustomWebClient()
        {
            Timeout = TimeSpan.FromSeconds(30);
        }

        internal TimeSpan Timeout { get; set; }

        protected override WebRequest GetWebRequest(Uri address)
        {
            WebRequest request = base.GetWebRequest(address);
            request.Timeout = (int) Timeout.TotalMilliseconds;
            return request;
        }
    }
}